package org.dreamfly.dreamalarm;

import android.os.Bundle;
import android.text.util.Linkify;
import android.widget.TextView;

import com.github.droidfu.activities.BetterDefaultActivity;

public class AboutActivity extends BetterDefaultActivity {

	String title="Dream Alarm aim to help you get up on time by all we can do.";
	String[] about={
			"1.The Dream Alarm contains waking up and reminding functions.",
			"2.The software provides a one-key getting up function to cancel all the wake-up alarms during one hour auto.",
			"3.You can use microblog to help getting up. But if you don't one-key getting up 15min before nearest the working time, we will call all friends to help you.",
			"4.If you can't hear how long time left to work, check this link for library: "};
	final String link="http://lib-for-dreamalarm.googlecode.com/files/text%2Bto%2Bspeech.apk";
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		this.setContentView(R.layout.aboutactivity);
		TextView t1=(TextView)findViewById(R.id.about_text_1);
		TextView t2=(TextView)findViewById(R.id.about_text_2);
		
		initStrings();
		
		String text=title+"\n\n";
		for(String s:about){
			text+=(s+'\n');
		}
		t1.setText(text);
		
		t2.setText(link);
		Linkify.addLinks(t2, Linkify.WEB_URLS);
	}
	
	private void initStrings(){
		title = getResourceString(R.string.aboutactivity_title);
		about[0] = getResourceString(R.string.aboutactivity_about1);
		about[1] = getResourceString(R.string.aboutactivity_about2);
		about[2] = getResourceString(R.string.aboutactivity_about3);
		about[3] = getResourceString(R.string.aboutactivity_about4);
	}
	
	private String getResourceString(int id){
		return this.getResources().getString(id);
	}
}
